<?php
$this->breadcrumbs = array(
    'Orders' => array('index'),
    'Manage',
);

$this->menu = array(
    array('label' => 'List Order', 'url' => array('index')),
    array('label' => 'Create Order', 'url' => array('create')),
);
?>

<div class="widget">
    <div class="head">
        <h5 class="iFrames">Order List</h5>
    </div>
    <div class="body">
        <?php
        $this->widget('zii.widgets.grid.CGridView', array(
            'id' => 'order-grid',
            'dataProvider' => $model->search(),
            'filter' => $model,
            'cssFile' => Yii::app()->baseUrl . Constant::CGRIDVIEW_CSS_URL,
            'template' => Constant::GRIDVIEW_TEMPLATE,
            'pager' => array(
                'header' => Constant::PAGER_HEADER,
                'cssFile' => Yii::app()->baseUrl . Constant::PAGER_CSS_URL,
                'prevPageLabel' => Constant::PAGER_PREV_PAGE_LABEL,
                'nextPageLabel' => Constant::PAGER_NEXT_PAGE_LABEL,
            ),
            'columns' => array(
                'orderId',
                'customerName',
                'customerEmail',
                'customerAddress',
                'customerPhone',
                'customerCity',
                /*
                  'customerCountry',
                  'createDate',
                 */
                array(
                    'header' => 'Items',
                    'class' => 'CButtonColumn',
                    'template' => '{view}',
                    'buttons' => array(
                        'view' => array(
                            'view' => 'view',
                            'imageUrl' => Yii::app()->request->baseUrl . Constant::CRUD_IMAGE_URL_VIEW,
                            'url' => 'Yii::app()->createUrl("' . Yii::app()->controller->id . '/viewitems", array("id" => $data->primaryKey))',
                        ),
                    ),
                ),
                array(
                    'header' => 'Commands',
                    'class' => 'CButtonColumn',
                    'template' => $template,
                    'htmlOptions' => array('width' => Constant::CBUTTONCOLUMN_WIDTH),
                    'buttons' => array(
                        'update' => array(
                            'update' => 'update',
                            'imageUrl' => Yii::app()->request->baseUrl . Constant::CRUD_IMAGE_URL_EDIT,
                        ),
                        'view' => array(
                            'view' => 'view',
                            'imageUrl' => Yii::app()->request->baseUrl . Constant::CRUD_IMAGE_URL_VIEW,
                        ),
                        'trash' => array(
                            'view' => 'trash',
                            'label' => 'Trash',
                            'imageUrl' => Yii::app()->request->baseUrl . Constant::CRUD_IMAGE_URL_TRASH,
                            'url' => 'Yii::app()->createUrl("' . Yii::app()->controller->id . '/trash", array("id" => $data->primaryKey))',
                        ),
                        'untrash' => array(
                            'view' => 'untrash',
                            'label' => 'Untrash',
                            'imageUrl' => Yii::app()->request->baseUrl . Constant::CRUD_IMAGE_URL_UNTRASH,
                            'url' => 'Yii::app()->createUrl("' . Yii::app()->controller->id . '/untrash", array("id" => $data->primaryKey))',
                        ),
                        'delete' => array(
                            'delete' => 'delete',
                            'imageUrl' => Yii::app()->request->baseUrl . Constant::CRUD_IMAGE_URL_DELETE,
                        ),
                    ),
                ),
            ),
        ));
        ?>
    </div>
</div>